<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改服务商分润调整项')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-agent-info-account-add" >
            <input name="type" th:value="${type}" id="type" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">服务商编号：</label>
                <div class="col-sm-8">
                    <input name="agentNum" th:value="${agentNum}" class="form-control" required readonly type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">服务商名称：</label>
                <div class="col-sm-8">
                    <input name="agentName" th:value="${agentName}" class="form-control"  required readonly type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">充值金额：</label>
                <div class="col-sm-8">
                    <input name="accountMoney"  class="form-control" required  type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">交易密码：</label>
                <div class="col-sm-8">
                    <input type="password" name="password" class="form-control" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">备注：</label>
                <div class="col-sm-8">
                    <input name="note" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">上传凭证：</label>
                <div class="col-sm-8">
                    <input type="file" name="file"  accept="image/*" />
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "agentInfo/account";
        $("#form-agent-info-account-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var formData = new FormData($("#form-agent-info-account-add")[0]);
                // formData.append("file", $("[name = 'file']")[0].files[0]);
                $.ajax({
                    url: prefix + "/saveBalance",
                    data: formData,
                    type: "post",
                    processData: false,
                    contentType: false,
                    success: function(result) {
                        $.operate.saveSuccess(result);
                    }
                })
            }
        }
    </script>
</body>
</html>